#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
	vector<int> mp;
	int a[] = { 5,7,7,8,8,10};
	int sz = sizeof(a) / sizeof(a[0]);
	for (int i = 0; i < sz; i++)
	{
		mp.push_back(a[i]);
	}
	int target = 8;
	auto p1 = lower_bound(mp.begin(), mp.end(), target);
	auto p2 = upper_bound(mp.begin(), mp.end(), target);
	int len1 = p1 - mp.begin();
	int len2 = p2 - mp.begin() - 1;
	/*cout << *p1 << ' ' << *p2 << endl;
	cout << len1 << ' ' << len2 << endl;*/
	//cout << *p1 << " ";
	cout << len1 << ' ' << len2 << endl;
	return 0;
}